<template>
    <div>
        <van-button
                square
                :text="buttonText"
                :type="buttonType"
                class="delete-button"
                @click="handleDelete"
        />
    </div>
</template>

<script>
    export default {
        name: "cartzj",
        props: {
            itemId: {
                type: [Number, String],
                required: true
            },
            buttonText: {
                type: String,
                default: '删除'
            },
            buttonType: {
                type: String,
                default: 'danger'
            }
        },
        methods: {
            handleDelete() {
                // 触发删除事件并传递商品ID
                this.$emit('delete', this.itemId);
            }
        }
    }
</script>

<style scoped>
    .delete-button[data-v-2c476460] {
        height: 160px !important;
    }
    .delete-button {
        height: 100% !important;
    }
</style>
